package zh.stu.StrategyPattern.PayDemo;

/**
 * @Author：KoVaVo
 * @Date：2020-11-01 16:14
 * @Version：1.0.0
 * @Description：模仿支付方式
 */
public class Order {

    private String uid;
    private String OrderId;
    private double amount;

    public Order(String uid, String orderId, double amount) {
        this.uid = uid;
        OrderId = orderId;
        this.amount = amount;
    }

    public MsgResult pay(String payKey){
        Payment payment = PayStrategy.get(payKey);
        System.out.println("使用"+payment.getName());
        System.out.println("交易金额"+amount);
        return payment.pay(uid,amount);
    }
}
